Example Program
Global Alignments
Computing an optimal global alignment between two sequences.
File "alignment.cpp"
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 |
Here are some sequences to align:
10 | |
11 |
Now we choose a scoring scheme with affine gap costs ("gap open" == -2, "gap extend" == -1).
12 |
Example 1: We use Align to align the two sequences.
Since we does not specify an algorithm tag when we call globalAlignment,
a suitable algorithm (Gotoh) is automatically choosen.
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 |
Example 2: We now choose explicitely the algorithm MyersHirschberg.
Since this algorithm always works on Levenshtein distance, score is ignored here.
Therefore, this algorithm computes a different alignment and returns a different score.
20 | |
21 |
Example 3: We now do the same as in case 1, but now we use an Alignment Graph for storing the alignment.
Here we use Hirschberg's algorithm.
22 | |
23 | |
24 | |
25 | |
26 | |
27 | |
28 | |
29 | |
30 | |
31 | |
32 | |
33 | |
34 |
SeqAn - Sequence Analysis Library - www.seqan.de